package com.cn.sys.frame.service;

import java.util.List;
import java.util.Map;

import com.cn.sys.frame.util.page.PageData;
import com.cn.sys.frame.util.query.QueryCondition;

public interface BaseService<T, PK> {

	public T get(PK id) throws Exception;
	
	public T save(T entity) throws Exception;
	
	public T saveWithOutPK(T entity) throws Exception;
	
	//public int batchSave(Collection<T> entitys) throws Exception;
	
	public T update(T entity) throws Exception;
	
	//public int batchUpdate(Collection<T> entitys) throws Exception;
	
	public int delete(PK id) throws Exception;
	
	public long getCount(QueryCondition queryCondition) throws Exception;
	
	public List<T> getAll() throws Exception;
	
	public PageData<T> getPageData(PageData<T> pageData, QueryCondition queryCondition) throws Exception;
	
	public PageData<Map<String, Object>> getPageMapData(PageData<Map<String, Object>> pageData, QueryCondition queryCondition) throws Exception;
}
